using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblLinhVucChuyenGiaUI
{ 
	private int idLinhVucChuyenGia;
	public int IdLinhVucChuyenGia
	{
		get { return idLinhVucChuyenGia;}
		set { idLinhVucChuyenGia = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private int idLinhVuc;
	public int IdLinhVuc
	{
		get { return idLinhVuc;}
		set { idLinhVuc = value;}
	}

	public tblLinhVucChuyenGiaUI() {}

	public tblLinhVucChuyenGiaUI(int idLinhVucChuyenGia, int idChuyenGia, int idLinhVuc)
	 {
		this.idLinhVucChuyenGia = idLinhVucChuyenGia;
 		this.idChuyenGia = idChuyenGia;
 		this.idLinhVuc = idLinhVuc;
 	}

	public int Add(int idChuyenGia, int idLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblLinhVucChuyenGia_Add",idChuyenGia,idLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idLinhVucChuyenGia, int idChuyenGia, int idLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblLinhVucChuyenGia_Update",idLinhVucChuyenGia,idChuyenGia,idLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idLinhVucChuyenGia)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblLinhVucChuyenGia_Delete",idLinhVucChuyenGia);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblLinhVucChuyenGia_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idLinhVucChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblLinhVucChuyenGia_Get",idLinhVucChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblLinhVucChuyenGia_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblLinhVucChuyenGia_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdLinhVuc(int idLinhVuc)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblLinhVucChuyenGia_GetByIdLinhVuc",idLinhVuc);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
